//
//  EngineerCell.m
//  PianoAndPoemDirectSeeding
//
//  Created by 梅津山 on 2017/7/21.
//  Copyright © 2017年 梅津山. All rights reserved.
//

#import "EngineerCell.h"
#import <AVOSCloud/AVOSCloud.h>
#import  <UIImageView+AFNetworking.h>

@interface EngineerCell ()

@property (weak, nonatomic) IBOutlet UIImageView *headerView;
@property (weak, nonatomic) IBOutlet UILabel *nameL;
@property (weak, nonatomic) IBOutlet UILabel *titleL;
@property (weak, nonatomic) IBOutlet UILabel *padenL;

@property (weak, nonatomic) IBOutlet UILabel *timeL;


@end


@implementation EngineerCell

- (void)awakeFromNib {
    [super awakeFromNib];
    _headerView.layer.cornerRadius = 12.5;
    _headerView.layer.masksToBounds = YES;
}

-(void)setNews:(HomeModel *)news{
    _news = news;
    
    _padenL.text = _news.grade;
    
    _nameL.text = _news.name;
    [_headerView setImageWithURL:[NSURL URLWithString:_news.image]];
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
    _timeL.text = [dateFormatter stringFromDate:_news.createdAt];
    _titleL.text = [NSString stringWithFormat:@"%@\n  %@",_news.location,_news.particulars];
}


@end
